<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>


<div class="row">
    <div class="span6">
        <legend>User</legend>
        <table class="table">
            <tr>
                <td>Email</td>
                <td><s:property value="user.email" /></td>
            </tr>
            <tr>
                <td>Title</td>
                <td><s:property value="user.title" /></td>
            </tr>
            <tr>
                <td>First Name</td>
                <td><s:property value="user.firstName" /></td>
            </tr>
            <tr>
                <td>Last Name</td>
                <td><s:property value="user.lastName" /></td>
            </tr>
            <tr>
                <td>Phone</td>
                <td><s:property value="user.phone" /></td>
            </tr>
            <tr>
                <td>Address</td>
                <td><s:property value="user.address" /></td>
            </tr>
            <tr>
                <td>Introduction</td>
                <td><s:property value="user.introduction" /></td>
            </tr>       
            <tr>
                <td>Avatar</td>
                <td><s:property value="user.avatar" /></td>
            </tr>  
            <tr>
                <td>Status</td>
                <td><s:property value="user.status" /></td>
            </tr>  
        </table>    
    </div>    
            
    <div class="span6">
        <h3>Assigned Roles</h3>
        <table class="table-striped table">
            <tr>
                <th>Role name</th>
                <th>Description</th>
            </tr>
            
            <s:iterator value="roles" var="role">
               <tr>
                   <td><s:property value="#role.roleName" /></td> 
                   <td><s:property value="#role.description" /></td> 
               </tr>              
            </s:iterator>   
        </table>
        <h3>Assign a Role</h3>
        
        <s:form cssClass="form-horizontal" action="AdminUser/addRole" method="POST">
            <div class="control-group">
              <label class="control-label" for="tiles_user_role">Role</label>
              <div class="controls">
                 <s:select name="user.role" list="{'Author','Review','Admin'}"/>      
              </div>
            </div>   
            
                 <s:submit cssClass="btn pull-right" value="Add Role" /> 
        </s:form>
    </div>    
          <!-- Events --> 
 
    
    
</div>      
            <a href='<s:url action="AdminUser" />'>Back to index</a> 